#include #include #include using std::string; using std::cout; using std::cin; using std::endl; void main() { std::ofstream fout; //will create the file if it does not exist //if it does exist it destroys it //fout.open("junk2.txt", std::ios::app); //cout << std::ios::app << endl; ////fout << "this is a test"; //for(int i = 0; i < 10; i++) //{ // fout << "I will not talk in class," << rand() <<"," << i << endl; //} //fout.close(); fout.open("junk2.txt", std::ios::_Noreplace); if(!fout.fail()) { fout << "something" <> c; if(c == 'y') { fout.clear(); //forget about your failures fout.open("junk2.txt"); fout << "something" <